<?php

namespace app\admin\controller;

use think\Request;
use app\common\model\System as SysModel;
use app\common\server\Code;

class System extends Base
{
    public function set_ip(Request $request){
        try{
            if($request->isPost()){
                $content = $request->post('content');
                SysModel::setIp($content);
                return apiReturn();
            }else{
                $ip_list = SysModel::getIp();
                $this->assign("ip_list",$ip_list);
                return $this->fetch();
            }
        }catch (\Exception $e){
            return apiReturn(Code::$error,$e->getMessage());
        }
    }
}
